package crazy.memory;

public class InitTest1
{
	public static void main(String[] args)
	{
		new Wolf(5.6);
	}
}

class Creature
{
	{
		System.out.println("creature's init block");
	}
	
	public Creature()
	{
		System.out.println("creature's no parameter constructure");
	}
	
	public Creature(String name)
	{
		this();
		System.out.println("creature's has parameter construct, name="+name);
	}
	
}

class Animal extends Creature
{
	{
		System.out.println("Animal's init block");
	}

	
	public Animal(String name)
	{
		super(name);
		System.out.println("Animal has parameter construct, name="+name);
	}
	
	public Animal(String name, int age)
	{
		this(name);
		System.out.println("Animal's has 2 paraments construct, age="+age);
	}
}

class Wolf extends Animal
{
	{
		System.out.println("Wolf's init block");
	}
	
	public Wolf()
	{
		super("huitailang", 3);
		System.out.println("Wolf has no parameter construct");
	}
	
	public Wolf(Double weight)
	{
		this();
		System.out.println("Wolf's has parameter construct, weight="+weight);
	}
}